
//
//  Week_ItemView.m
//  MindBox
//
//  Created by MS on 16-1-4.
//  Copyright (c) 2016年 Lemon. All rights reserved.
//

#import "Week_ItemView.h"
#import "UIImageView+WebCache.h"
@interface Week_ItemView ()





@end

@implementation Week_ItemView

+(instancetype)week_itemViewWithXib
{
     return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
}

-(void)setWeek:(Week *)week
{
    _week = week;
    
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:week.image_url]];
    
    self.titleView.text = week.short_name;
    
    NSString * price =nil;
    if ([week.p_price floatValue]) {
       price = [NSString stringWithFormat:@"¥ %.2f",[week.p_price floatValue]];
    }
    else{
        price = [NSString stringWithFormat:@"¥ %.2f",[week.price floatValue]];
    }
   
    self.priceView.text = price;

}



@end
